package socketmvc.core.packets.biz;

import socketmvc.core.packets.PacketStaticFactory;
import socketmvc.core.packets.basic.JsonBasicPacket;
import socketmvc.core.packets.basic.IPacket;

public class BeatHeartMessage implements IMessage<Byte> {

    private Byte content;
    private final String id;

    public BeatHeartMessage() {
        this.id = String.valueOf(System.currentTimeMillis());
    }

    @Override
    public String getId() {
        return this.id;
    }

    @Override
    public Integer getType() {
        return 0;
    }


    @Override
    public Long getCreateAt() {
        return null;
    }

    @Override
    public Byte getContent() {
        return content;
    }

    @Override
    public IPacket toPacket(String cmd) {
        JsonBasicPacket packet = PacketStaticFactory.createSimplePacket(this);
        packet.setCommand(cmd);
        return packet;
    }

    public void setContent(Byte content) {
        this.content = content;
    }
}
